<div ng-hide="host.hasSubscription()">
  <div data-extend-template="common/views/registration.html"></div>
</div>

<div ng-if="host.hasSubscription()">
  <div bst-alert="info">
    {{ "Below are the repository content sets currently available for this content host through its subscriptions. For Red Hat subscriptions, additional content can be made available through the" | translate}}
    <a ng-href="/katello/providers/redhat_provider" translate>Red Hat Repositories page</a>.
    {{ "Changing default settings requires subscription-manager version 1.10 or newer to be installed on this host." | translate }}
  </div>

  <div class="loading-mask loading-mask-panel" ng-show="displayArea.working">
    <i class="fa fa-spinner fa-spin"></i>
    <span translate>Loading..."</span>
  </div>

  <div data-extend-template="layouts/partials/table.html">
    <div data-block="filters">
      <label class="checkbox-inline" title="{{ 'Show all Repository Sets in Organization' | translate }}" ng-if="!simpleContentAccessEnabled">
        <input type="checkbox" ng-model="contentAccessModes.contentAccessModeAll" ng-change="toggleFilters()"/>
        <span translate>Show All</span>
      </label>
      <label class="checkbox-inline" title="{{ 'Limit Repository Sets to only those available in this Host\'s Lifecycle Environment' | translate }}">
        <input type="checkbox" ng-model="contentAccessModes.contentAccessModeEnv" ng-change="toggleFilters()"/>
        <span translate>Limit to Lifecycle Environment</span>
      </label>
    </div>

    <div data-block="list-actions">
      <span select-action-dropdown>
        <ul class="dropdown-menu-right" uib-dropdown-menu role="menu" aria-labelledby="split-button">
          <li role="menuitem" ng-show="permitted('edit_activation_keys', activationKey)" ng-class="{disabled: table.numSelected === 0}">
            <a ng-click="overrideToEnabled()" disable-link="table.numSelected === 0" translate>
              Override to Enabled
            </a>
          </li>

          <li role="menuitem" ng-show="permitted('edit_activation_keys', activationKey)" ng-class="{disabled: table.numSelected === 0}">
            <a ng-click="overrideToDisabled()" disable-link="table.numSelected === 0" translate>
              Override to Disabled
            </a>
          </li>

          <li role="menuitem" ng-show="permitted('edit_activation_keys', activationKey)" ng-class="{disabled: table.numSelected === 0}">
            <a ng-click="resetToDefault()" disable-link="table.numSelected === 0" translate>
              Reset to Default
            </a>
          </li>
        </ul>
      </span>
    </div>

    <span data-block="no-rows-message" translate>
      No repository sets provided through subscriptions.
    </span>

    <span data-block="no-search-results-message" translate>
      Your search returned zero repository sets.
    </span>

    <div data-block="table">
      <table class="table table-bordered table-striped" ng-class="{'table-mask': table.working}">
        <thead>
          <tr bst-table-head row-select>
            <th bst-table-column="repository_name" translate>Repository Name</th>
            <th bst-table-column="product_name" translate>Product Name</th>
            <th bst-table-column="repository_path" translate>Repository Path</th>
            <th bst-table-column="enabled" translate>Status</th>
          </tr>
        </thead>

        <tbody>
          <tr class="grey-table-row" bst-table-row ng-repeat-end ng-repeat="productRepoSet in table.rows | filter:repositorySetFilter" row-select="productRepoSet">
            <td bst-table-cell>{{ productRepoSet.content.name }}</td>
            <td bst-table-cell>
              <a ui-sref="product.info({productId: productRepoSet.product.id})">
                {{ productRepoSet.name }}
              </a>
            </td>
            <td bst-table-cell>{{ productRepoSet.contentUrl }}</td>
            <td bst-table-cell>{{ productRepoSet | repositorySetsEnabled }}</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>
